package com.yzh.sharding.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author yzh
 * @since 2019-11-04
 */
@ApiModel(value="VoucherSale对象", description="")
@TableName("t_voucher_sale")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Builder
@Data
public class VoucherSale extends Model<VoucherSale> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "id")
    private String id;

    @ApiModelProperty(value = "批次id")
    @TableField("apply_id")
    private String applyId;

    @ApiModelProperty(value = "'券类型，券类型。 0：代金劵；1：折扣劵；2：兑换劵；3: 其他   4: 0元兑换券, 5:商品券, 6:异业券,7.商家券',")
    @TableField("type")
    private Integer type;

    @ApiModelProperty(value = "劵号")
    @TableField("voucher_no")
    private String voucherNo;

    @ApiModelProperty(value = "生成日期")
    @TableField("make_date")
    private LocalDate makeDate;

    @ApiModelProperty(value = "劵状态 0:未使用  1：已使用  2：作废")
    @TableField("status")
    private Integer status;

    @ApiModelProperty(value = "持劵人")
    @TableField("member_code")
    private String memberCode;

    @ApiModelProperty(value = "密码")
    @TableField("bind_password")
    private String bindPassword;

    @ApiModelProperty(value = "APP绑券时间")
    @TableField("bind_datetime")
    private LocalDateTime bindDatetime;

    @ApiModelProperty(value = "绑定状态 0:未绑定 1:已绑定")
    @TableField("bind_status")
    private Integer bindStatus;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "使用时间")
    @TableField("use_time")
    private LocalDateTime useTime;

    @ApiModelProperty(value = "t_voucher表的Id字段")
    @TableField("voucher_id")
    private String voucherId;

    @ApiModelProperty(value = "院线编码")
    @TableField("company_code")
    private String companyCode;

    @ApiModelProperty(value = "推广码")
    @TableField("invite_code")
    private String inviteCode;

    @ApiModelProperty(value = "券获得渠道 1:直接绑定  会员关怀(2-13) 相关渠道  红包：21票务定向红包22购票赠送红包23限量领取红包24附近商家红包25卖品定向红包26购物赠送红包27影院评价送红包")
    @TableField("chanel")
    private Integer chanel;

    @ApiModelProperty(value = "有效截止日期")
    @TableField("deadline")
    private LocalDateTime deadline;

    @ApiModelProperty(value = "删除标识0:未删除 1:删除")
    @TableField("del_flag")
    @TableLogic
    private Integer delFlag;

    @ApiModelProperty(value = "购票购卖品送的券，记录订单号")
    @TableField("from_order_no")
    private String fromOrderNo;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
